﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ywxt.Common;

namespace DB_NH.DB_Model.ywxt
{
    /// <summary>
    /// 流程记录
    /// </summary>
    [Serializable]
    public class wf_node
    {
        #region 数据表名称
        public static readonly string TableName = "wf_node";
        #endregion

        #region 数据表字段结构
        public struct Columns
        {
            /// <summary>
            /// ID
            /// </summary>
            public static readonly string n_id = @"n_id";

            /// <summary>
            /// 创建人姓名
            /// </summary>
            public static readonly string creator_name = @"creator_name";

            /// <summary>
            /// 创建人ID
            /// </summary>
            public static readonly string creator_id = @"creator_id";

            /// <summary>
            /// 盖章所属项目ID
            /// </summary>
            public static readonly string gz_proj_id = @"gz_proj_id";

            /// <summary>
            /// 审批记录代码
            /// </summary>
            public static readonly string n_code = @"n_code";

            /// <summary>
            /// 审批类型ID
            /// </summary>
            public static readonly string n_type_id = @"n_type_id";

            /// <summary>
            /// 审批记录标题，用于保存申请的简单描述
            /// </summary>
            public static readonly string n_title = @"n_title";

            /// <summary>
            /// 审批记录正文，保存的是审批内容，应根据节点类型由模板生产
            /// </summary>
            public static readonly string n_contnent = @"n_contnent";

            /// <summary>
            /// 节点开始日期
            /// </summary>
            public static readonly string n_begin_date = @"n_begin_date";

            /// <summary>
            /// 结束标志
            /// </summary>
            public static readonly string n_end_flag = @"n_end_flag";

            /// <summary>
            /// 节点完成日期
            /// </summary>
            public static readonly string n_end_date = @"n_end_date";

            /// <summary>
            /// 备注
            /// </summary>
            public static readonly string n_remark = @"n_remark";

            /// <summary>
            /// 流程执行标志：0、未启动；1、启动未执行；99、已执行
            /// </summary>
            public static readonly string n_do_flag = @"n_do_flag";


            /// <summary>
            /// 是否有效标志
            /// </summary>
            public static readonly string is_valid = @"is_valid";

            /// <summary>
            /// 创建时间
            /// </summary>
            public static readonly string create_date = @"create_date";


            /// <summary>
            /// 用户所属部门ID
            /// </summary>
            public static readonly string dept_id = @"dept_id";
        }
        #endregion

        #region 字段
        /// <summary>
        /// 记录ID
        /// </summary>
        public virtual string n_id { get; set; }

        /// <summary>
        /// 创建人姓名
        /// </summary>
        public virtual string creator_name { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public virtual t_sys_user creator_user { get; set; }

        /// <summary>
        /// 审批记录代码
        /// </summary>
        public virtual string n_code { get; set; }

        /// <summary>
        /// 审批类型
        /// </summary>
        public virtual wf_type n_type { get; set; }

        /// <summary>
        /// 审批记录标题，用于保存申请的简单描述
        /// </summary>
        public virtual string n_title { get; set; }

        /// <summary>
        /// 审批记录正文，保存的是审批内容，应根据节点类型由模板生产
        /// </summary>
        public virtual string n_contnent { get; set; }

        /// <summary>
        /// 节点开始日期
        /// </summary>
        public virtual DateTime n_begin_date { get; set; }

        /// <summary>
        /// 结束标志
        /// </summary>
        public virtual int n_end_flag { get; set; }

        /// <summary>
        /// 节点完成日期
        /// </summary>
        public virtual DateTime n_end_date { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public virtual string n_remark { get; set; }

        /// <summary>
        /// 流程执行标志：0、未启动；1、启动未执行；99、已执行
        /// </summary>
        public virtual int n_do_flag { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public virtual int is_valid { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual DateTime create_date { get; set; }

        /// <summary>
        /// 流程节点的审批活动列表
        /// </summary>
        public virtual IList<wf_action> actions { get; set; }
        #endregion

        public wf_node()
        {
            n_id = Common.NewID();
            is_valid = 1;
            create_date = DateTime.Now;

            creator_user = new t_sys_user();
            n_type = new wf_type();

            actions = new List<wf_action>();
        }
    }
}
